package by.jabbby.service;

import org.jivesoftware.smack.packet.Presence;

import android.content.Context;
import by.jabbby.ui.act.R;

public enum Status {
	OnLine, OfLine, Disconnected, Reconnect, AuthorizationFaild;

	public String getLocalization(Context context) {
		switch (this) {
		case OnLine:
			
			return context.getString(R.string.status_state_online);
		case OfLine:
			return context.getString(R.string.status_state_ofline);
		case Disconnected:
			return context.getString(R.string.status_state_disconected);
		case Reconnect:
			return context.getString(R.string.status_state_reconnect);
		case AuthorizationFaild:
			return context.getString(R.string.status_state_authorization_faild);
		default:
			throw new IllegalStateException("String value is not define : " + this.name());
		}

	};

	public Presence.Type getPresenceType() {
		switch (this) {
		case OnLine:
			return Presence.Type.available;
		case OfLine:
			return Presence.Type.unavailable;
		default:
			throw new IllegalStateException("The present type is not support: " + this.name());
		}

	};
	
	public Presence.Mode getPresenceMode(){
		switch (this) {
		case OnLine:
			return Presence.Mode.available;
		case OfLine:
			throw new IllegalStateException("SThe present mode is not support: " + this.name());
		default:
			throw new IllegalStateException("The present mode is not support: " + this.name());
		}
		
	}
	
	//public static Activity acc;

}
